package com.itheima.Mapper;

import com.github.pagehelper.Page;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.pojo.CheckItem;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CheckItemMapper {

    @Insert("insert into t_checkitem(code, name, sex, age, price, type, attention, remark) " +
            "VALUES (#{code},#{name},#{sex},#{age},#{price},#{type},#{attention},#{remark}) ")
    void add(CheckItem checkItem);

    @Select("select * from t_checkitem")
    Page<CheckItem> pageQuery(QueryPageBean queryPageBean);

    void update(CheckItem checkItem);

    @Select("select * from t_checkitem where code = #{idName}")
    List<CheckItem> searchById(Long idName);
    @Select("select * from t_checkitem where name = #{idName}")
    List<CheckItem> searchByName(Long idName);
}
